package com.example.tdck.controller;

import com.example.tdck.utils.ResponseHelper;
import com.example.tdck.pojo.major;
import com.example.tdck.service.MajorService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author:fjk
 * @Date: 2023/1/30 18:41
 */
@RestController
@RequestMapping("/api/tdck")
public class MajorController {
    @Resource
    private MajorService service;

    @RequestMapping(value = "/getMajorByKey",method = RequestMethod.GET)
    public ResponseHelper<List<major>> getMajorList(@RequestParam("key") String key){
        List<major> majorList = service.getMajorByKey(key);
        ResponseHelper response = new ResponseHelper<>(majorList);
        return response;
    }
}